//
//  UIView+THAddForRoundedCorner.h
//  MengLiao
//
//  Created by xiuxin on 2022/7/15.
//  Copyright © 2022 BaseBusiness. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIView (THAddForRoundedCorner)

/**
 设置一个四角圆角
 @param radius 圆角半径
 */
- (void)zh_roundedCornerWithRadius:(CGFloat)radius;

/**
 设置一个普通圆角(需要提前设置frame)
 @param radius  圆角半径
 @param corners 圆角位置
 */
- (void)zh_roundedCornerWithRadius:(CGFloat)radius
                           corners:(UIRectCorner)corners;
/**
 设置一个普通圆角
 @param radius  圆角半径
 @param borderColor 边框颜色
 @param borderWidth 边框宽度
 */
- (void)zh_roundedCornerWithRadius:(CGFloat)radius
                       borderColor:(UIColor *)borderColor
                       borderWidth:(CGFloat)borderWidth;

/**
 设置一个带边框的圆角(需要提前设置frame)

 @param cornerRadii 圆角半径cornerRadii
 @param corners     圆角位置
 @param borderColor 边框颜色
 @param borderWidth 边框线宽
 */
- (void)zh_roundedCornerWithCornerRadii:(CGSize)cornerRadii
                                corners:(UIRectCorner)corners
                            borderColor:( UIColor *)borderColor
                            borderWidth:(CGFloat)borderWidth;
@end

@interface CALayer (THAddForRoundedCorner)

/**如下分别对应UIView的相应API*/

- (void)zh_roundedCornerWithRadius:(CGFloat)radius;

- (void)zh_roundedCornerWithRadius:(CGFloat)radius
                       borderColor:(UIColor *)borderColor
                       borderWidth:(CGFloat)borderWidth;

- (void)zh_roundedCornerWithRadius:(CGFloat)radius
                           corners:(UIRectCorner)corners;

- (void)zh_roundedCornerWithCornerRadii:(CGSize)cornerRadii
                                corners:(UIRectCorner)corners
                            borderColor:(UIColor *)borderColor
                            borderWidth:(CGFloat)borderWidth;

@end

NS_ASSUME_NONNULL_END
